#import "RNEditItemBackgroundView.h"

@implementation RNEditItemBackgroundView

@synthesize backgroundColor = backgroundColor_;
@synthesize separatorColor = separatorColor_;

-(id)initWithFrame:(NSRect)theFrame {
    if (!(self = [super initWithFrame:theFrame]))
        return nil;
    
    [self setBackgroundColor:[NSColor colorWithCalibratedWhite:0.98f alpha:1.0f]];
    [self setSeparatorColor:[NSColor colorWithCalibratedWhite:0.85f alpha:1.0f]];
    return self;
}

-(void)drawRect:(NSRect)frame {
    frame = [self bounds];
    NSBezierPath *path = [NSBezierPath bezierPathWithRect:frame];
    [[self backgroundColor] setFill];
    [path fill];
    
    NSPoint bottomLeftPoint = frame.origin;
    NSPoint bottomRightPoint = NSMakePoint(frame.size.width, frame.origin.y);
    [[self separatorColor] setStroke];
    [NSBezierPath strokeLineFromPoint:bottomLeftPoint toPoint:bottomRightPoint];
}

- (void)mouseDown:(NSEvent *)theEvent {
    // Absorb mouse events
}

@end
